<!--应急求助-->
<template>
    <Dialog :openVis="visible" width="30%" :title="title" @close="closeDialog" :maskClosable="false">
        <template #container>
            <div class="police-con" :class="[themeType]">
                <div class="sub-text">有一个员工健康监测发生异常！</div>
                <div class="con-item">
                    <span>异常事件：</span>
                    <span>{{ userInfo?.eventType_dictText }}</span>
                </div>
                <div class="con-item">
                    <span>姓名：</span>
                    <span>{{ userInfo?.realName }}</span>
                </div>
                <div class="con-item">
                    <span>二级单位：</span>
                    <span>{{ userInfo?.orgName }}</span>
                </div>
                <div class="con-item">
                    <span>手机号码：</span>
                    <span>{{ userInfo?.phone }}</span>
                </div>
                <div class="con-item">
                    <span>发生时间：</span>
                    <span>{{ userInfo?.warnTime }}</span>
                </div>
                <div class="con-item">
                    <span>发生地点：</span>
                    <span>{{ userInfo?.address || userInfo?.gpsErrorMsg }}</span>
                </div>
            </div>
        </template>
    </Dialog>
</template>
<script setup lang="ts">
    import Dialog from '/@/components/dialog/Dialog.vue';
    import { useDialog } from '/@/views/components/dialogHooks.ts';
    import { watch, ref } from 'vue';
    import { useTheme } from '/@/hooks/theme/useTheme.ts';

    const props = defineProps({
        record: Object,
    });
    const userInfo = ref({});
    const { themeType } = useTheme();
    watch(
        () => props.record,
        (nVal) => {
            userInfo.value = nVal;
        }
    );
    const { visible, title, closeDialog, openDialog } = useDialog({ title: '健康监测工具报警' });

    defineExpose({
        openDialog,
    });
</script>
<style scoped lang="less">
    .police-con {
        color: #ffffff;
        background-color: #00152b;
        padding: 2% 0 2% 5%;

        .sub-text {
            font-weight: bold;
            margin-left: 8px;
        }

        .con-item {
            padding: 1.3% 0;
            display: flex;

            span:nth-child(1) {
                font-weight: bold;
                text-align: right;
                display: inline-flex;
                justify-content: flex-end;
                width: 80px;
            }

            span:nth-child(2) {
                flex: 1;
                padding-left: 2%;
                padding-right: 2%;
            }
        }
    }
</style>
